/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package isnmp.ui.dto;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import sg.simple.snmp.stats.TableData;


public class CPUInfo extends TableData {

	Map<String, Object> values = new HashMap<String, Object>();

  

	public enum CPU_PROPERTY {

		FIRM_WARE_ID("Firmware ID"), LOAD("Load Percentage")/*, DEVICE_TYPE("Device Type")*/;

		String displayName;

		private CPU_PROPERTY(String n) {
			this.displayName = n;
		}

		public String getDisplayName() {
			return displayName;
		}

		@Override
		public String toString() {
			return this.displayName;
			}
		}


	public void putValue(CPU_PROPERTY code, Object value) {
		values.put(code.getDisplayName(), value);
	}

	
	@Override
	public int getCellCount() {
		return values.size();
	}

	@Override
	public  String getPropertyName(int columnIndex) {
		
             CPU_PROPERTY[] enumValues = CPU_PROPERTY.values();
             return enumValues[columnIndex].getDisplayName();
	}

	public CPUInfo() {
	}

	@Override
	public Object getValue(String key) {
		return values.get(key);
	}

        
        @Override
        public Object getCellData(int columnIndex) {
            
          CPU_PROPERTY[] enumValues = CPU_PROPERTY.values();
          
          return getValue(enumValues[columnIndex].getDisplayName());            
        }

	@Override
	public String toString() {
		return "CPUInfo [values=" + values + "]";
	}

}
